import React, { Component } from 'react'
import {
  SafeAreaView,
  ScrollView,
  StatusBar,
  StyleSheet,
  Text,
  useColorScheme,
  View,
  Button,
  Alert,
} from 'react-native'

export default class index extends Component {

  alertFn = () => {
    Alert.alert(
      '警告标题',
      '警告内容',
      [
        {
          text: '稍后提醒',
          onPress: () => {
            console.log('取消 ~')
          },
        },
        {
          text: '取消',
          style: 'cancel',
          onPress: () => {
            console.log('取消 ~')
          },
        },
        {
          text: '确认',
          style: 'default',
          onPress: () => {
            console.log('确认 ~')
          },
        }
      ]
    )
  }

  render() {
    return (
      <View style={[styles.container]}>
        <Button
          title="点击进入RN世界 ~"
          onPress={() => {
            console.log('你好，RN ~')
            alert('你好，RN ~')
          }}
        />

        <Button
          title="发射"
          color={'red'}
          onPress={this.alertFn}
        />
      </View>
    )
  }
}

const styles = StyleSheet.create({
  container: {
    flex: 1
  },
})
